#include "wd.h"
int temp_rx;
//通过串口2获得温度数据
void get_temp(void)
{
    static int wd_temp[3];
    static int i = 0;
    wd_temp[i++] = Rx2Msg[0];
    if(i == 3)
    {//通过判断结束符e来重构数据
        if(wd_temp[2] == 'e')
        {
            temp_rx = (wd_temp[0]-48) * 10 + wd_temp[1] - 48;
            HAL_IWDG_Refresh(&hiwdg);
            i = 0;
        }
        else if (wd_temp[1] == 'e')
        {
            temp_rx = (wd_temp[2]-48) * 10 + wd_temp[0] - 48;
            HAL_IWDG_Refresh(&hiwdg);
            i = 0;            
        }
        else if (wd_temp[0] == 'e')
        {
            temp_rx = (wd_temp[1]-48) * 10 + wd_temp[2] - 48;
            HAL_IWDG_Refresh(&hiwdg);
            i = 0;   
        }
        i = 0;
        
        
    }
}
